package com.thirteenClassicsServer.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.github.pagehelper.Page;
import com.thirteenClassics.dto.BookPageQueryDTO;
import com.thirteenClassics.entity.Book;
import com.thirteenClassics.entity.OperationHistory;

@Mapper
public interface OperationHistoryMapper {


    Page<Book> pageQuery(BookPageQueryDTO bookPageQueryDTO);

    void insert(OperationHistory operationHistory);

    @Delete("delete from book where id = #{id}")
    void deleteById(Long id);

    void update(OperationHistory operationHistory);

    @Select("select * from book where id= #{id}")
    Book selectbookById(Long id);

    @Select("select * from operation_history where user_id= #{userId} and book_id= #{bookId} and action=#{action}")
    OperationHistory selectIndex(OperationHistory operationHistory);

}
